package day1_java数据类型变量;

import java.util.Scanner;

public class Demo07FlowControl {
    // if  if..else  if...else if...else  三目运算符  for  while  do...while
    public static void main(String[] args) {
        if (9 > 10) {
            System.out.println("真");
        } else {
            System.out.println("假");
        }

        Scanner s1 = new Scanner(System.in);
        System.out.println("请输入学生成绩:");
        int score = s1.nextInt();
        if (score > 90) {
            System.out.println("优秀");
        } else if (score > 80) {
            System.out.println("良好");
        } else if (score > 70) {
            System.out.println("一般");
        } else {
            System.out.println("差");
        }

        // 30
        switch (score) {
            case 30:
                System.out.println("这是30");
                break;
            case 90:
                System.out.println("这个是90");
                break;
            default:
                System.out.println("默认值是60吧");
        }

        System.out.println(score > 90 ? "做的还行" : "真差劲");

        /*
            const numArr:number[] = [1, 2, 3, 4, 5]
            for (let i = 0; i < numArr.length; i++) { console.log(i) }
        * */
        for (int i = 0; i < 4; i++) {
            System.out.println(i);
            // continue   break
        }

        int num1 = 1;
        while(num1 < 10) {
            System.out.println("num1===" + num1);
            num1++;
        }

        num1 += 10;
        do {
            System.out.println("num1---do--" + num1);
            if (num1 == 18) break;
            num1--;
        } while (num1 > 10);

        // 嵌套循环

    }
}
